package com.ruoyi.project.system.label.service;

import java.util.HashMap;
import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.ruoyi.common.utils.security.ShiroUtils;
import com.ruoyi.project.system.label.domain.Label;
import com.ruoyi.project.system.label.mapper.LabelMapper;
import com.ruoyi.project.system.user.domain.User;

@Service
public class LabelServiceImpl implements ILabelService{
	@Autowired
	private LabelMapper labelMapper;
	@Override
	public int saveLabel(Label label) {
		label.setCreateBy(ShiroUtils.getLoginName());
		label.setUpdateBy(ShiroUtils.getLoginName());
		return labelMapper.saveLabel(label);
	}
	@Override
	public int updateLabel(Label label) {
		// TODO Auto-generated method stub
		label.setUpdateBy(ShiroUtils.getLoginName());
		return labelMapper.updateLabel(label);
	}
	@Override
	public List<HashMap> selectByUser(User user) {
		// TODO Auto-generated method stub
		return labelMapper.selectByUser(user);
	}

	@Override
	public List<HashMap> selectLabelList(Label label) {
		// TODO Auto-generated method stub
		return labelMapper.selectLabelList(label);
	}
	@Override
	public Label selectLabel(Long userId, Long pictureId) {
		// TODO Auto-generated method stub
		return labelMapper.selectLabel(userId, pictureId);
	}
}
